import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ty_smart_watch/common/images_url.dart';
import 'package:ty_smart_watch/page/obd/car_base_info.dart';
import 'package:ty_smart_watch/page/obd/car_control.dart';
import 'package:ty_smart_watch/page/obd/net_state.dart';
import 'package:ty_smart_watch/page/obd/obd_device_info.dart';
import 'package:ty_smart_watch/utils/Log.dart';

class ObdPage extends StatefulWidget {
  const ObdPage({super.key});

  @override
  State<ObdPage> createState() => _ObdPageState();
}

class _ObdPageState extends State<ObdPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: const Icon(Icons.arrow_back_ios),
            onPressed: () {
              Get.back();
            },
          ),
          title: Text("OBD设备"),
          centerTitle: true,
          actions: [
            IconButton(
                onPressed: () {
                  Log.d("编辑OBD名称");
                },
                icon: Image.asset(ICON_OBD_EDIT, width: 20, height: 20))
          ],
        ),
        body: Container(
          margin: EdgeInsets.symmetric(horizontal: 10),
          child: Column(
            children: [
              Row(
                children: [CarBaseInfo(), Expanded(child: Container()), NetState()],
              ),
              SizedBox(height: 10),
              Row(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  ObdDeviceInfo(),
                  Expanded(child: Container()),
                  Image.asset(
                    ICON_CAR_WATER_TEMPERATURE,
                    height: 36,
                  )
                ],
              ),
              CarControl(),

            ],
          ),
        ));
  }
}
